# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-policykit
pkgver=1.1.0
pkgrel=0
pkgdesc="LXQt PolicyKit agent"
url="https://github.com/lxqt/lxqt-policykit"
# s390x, riscv64: blocked by polkit-qt
# armhf blocked by liblxqt-dev
arch="all !s390x !armhf !riscv64"
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev qt5-qttools-dev
	polkit-qt-1-dev kwindowsystem-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="https://github.com/lxqt/lxqt-policykit/releases/download/$pkgver/lxqt-policykit-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname-agent
}

sha512sums="
41592a2f086c5308ed71ef856bba8c3f81aa392700696e8a82554ce049bec07f41221a9862244d22f732b8f09a7c157596a50ef48bd30f1acf491317c4e21d12  lxqt-policykit-1.1.0.tar.xz
"
